using System;
using System.Collections.Generic;
using System.Text;

using org.synthful.Windows.Forms;

namespace org.synthful.Tabination
{
    public class PopupMenuUrlItem : PopupMenuItem
    {
        public Uri theURL;

        [System.ComponentModel.Browsable(true),
        System.ComponentModel.Description("URL"),
        System.ComponentModel.Category("Appearance")
        ]
        public Uri URL
        {
            get
            {
                if (this.theURL==null || this.theURL.ToString().Length == 0)
                    if (base.Text != null && base.Text.Length > 0)
                        this.theURL = new Uri(base.Text);

                return this.theURL;
            }
            set
            {
                this.theURL = value;
                this.ToolTipText = value.ToString();
            }
        }

        new public string Text
        {
            get
            {
                if (base.Text == null || base.Text.Length==0)
                    if (this.theURL != null && this.theURL.ToString().Length > 0)
                        return this.theURL.ToString();

                return base.Text;
            }
            set
            {
                base.Text = value;
            }
        }
    }
}
